package com.sky.controller.user;

import com.sky.dto.OrdersSubmitDTO;
import com.sky.result.Result;
import com.sky.service.OrderServer;
import com.sky.vo.OrderSubmitVO;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/order")
@Api(tags="C端订单接口")
@Slf4j
public class OrderController {
    @Autowired
    private OrderServer orderServer;
    @PostMapping("/submit")
    public Result<OrderSubmitVO> saveOrder(@RequestBody OrdersSubmitDTO ordersSubmitDTO){
        OrderSubmitVO vo=orderServer.orderServer(ordersSubmitDTO);
        return Result.success(vo);
    }
}
